#include<stdio.h>

int a[25][25];

int main()
{
	int n;	scanf("%d", &n);
	int cnt = 1;
	for (int i = 1; i <= n; i++)
	{
		for (int j = 1; j <= i; j++)
			printf("%4d", cnt++);
		for (int j = i + 1; j <= n; j++)
			printf("%4d", 0);
		printf("\n");
	}
	return 0;
}